#### Table S21: Social desirability robustness ####

# Libraries
# library(tidyverse)
# library(here)
# library(rio)
# library(srvyr)
# library(survey)

sd_dta = import(here("Data","socialdesirability.rds")) |> 
  as_survey_design(weights = weight)

# Mods
mod_norm_sum = svyglm(norm_sum ~ sd_ind, sd_dta)
mod_norm_any = svyglm(norm_any ~ sd_ind, sd_dta)
mod_viol_sum = svyglm(viol_sum ~ sd_ind, sd_dta)
mod_viol_any = svyglm(viol_any ~ sd_ind, sd_dta)

stargazer::stargazer(mod_norm_sum, mod_norm_any, mod_viol_sum, mod_viol_any,
                     title = "Social Desirability Regression Results",
                     covariate.labels = c("Social\nDesirability"),
                     notes = "Estimated with survey weights and two-sided tests",
                     star.cutoffs = c(0.05, 0.01, 0.001),
                     omit.stat = c("aic","bic"),
                     type = "latex",
                     out = here("Tables","Supplementary","table_s21.tex"),
                     header = F)
